import OpenAI from 'openai';

const openai = new OpenAI({
    // apiKey: 'sk-9MmQUPP02CikLbmH76A85eDe9dF2433a8070D9D5EaDfA76e',
    // baseURL: "https://gpt.0kk.top/v1/",
    apiKey: 'sk-df50cc45c0ee4fc387486b8b42dbe73f',
    baseURL: "https://api.deepseek.com/v1/",
});

const stream = await openai.chat.completions.create({
    model: 'deepseek-chat',
    messages: [{ role: "user", content: "Say this is a test" }],
    stream: true,
});

const chunks = [];
for await (const chunk of stream) {
    chunks.push(chunk);
    console.log(`${chunk.choices[0].delta.content}|`);
}
